package com.coderlin.service;

import com.coderlin.entities.Customer;
import com.github.pagehelper.PageInfo;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * <Description> <br>
 *
 * @author Coder_Lin<br>
 * @version 1.0<br>
 * @taskId: <br>
 * @createDate 2021/07/22 13:48 <br>
 * @see com.coderlin.service <br>
 */
public interface CustomerService {
    /**
     * Service层接口用来数据访问
     *
     * @return:List<Customer></>
     */
    List<Customer> listCustomer();


    /**
     *
     * @return:List<Customer></>
     */
    List<Customer> searchCustomer(String userName);

    /**
     * 根据id查找Customer
     * @param cid
     * @return
     */
    Customer searchCustomerById(@Param("cid") int cid);

    /**
     * 添加用户
     * @param customer
     * @return
     */
    Integer addCustomer(Customer customer);

    /**
     * 根据id删除
     * @param cid
     * @return
     */
    Integer delCustomerById(@Param("cid") int cid);

    /**
     * update数据
     * @param customer
     * @return
     */
    Integer modCustomer(Customer customer);

    /**
     * 分页设置的每页数量
     */
    public final static int PAGE_SiZE = 3;

    /**
     * 查询列表分页
     * @param pageNum 当前页码
     * @return 分页对象
     */
    PageInfo<Customer> listCustomerForPage(Integer pageNum );

    /**
     * 表单搜索分页
     * @param pageNum 当前页码
     * @param custName 客户名称
     * @return 分页对象
     */
    PageInfo<Customer> searchCustomer(Integer pageNum,String custName);
}
